package com.Blili;

import org.junit.Test;

/**
 * B站第3题
 */
public class test3 {



    public int GetCoinCount (int N){
        int k = 1024 - N;
        int res = 0;
        while(k >= 64){
            res += k / 64;
            k = k % 64;
        }
        while(k >= 16){
            res += k / 16;
            k = k % 16;
        }
        while(k >= 4){
            res += k / 4;
            k = k % 4;
        }
        while(k > 1){
            res += 1 ;
            k --;
        }
        return res;
    }

    @Test
    public void test(){
        System.out.println(GetCoinCount(200));
    }

}
